package com.huarui.purchaseOrder.action;

import java.util.HashMap;

import java.util.Map;

import org.apache.log4j.Logger;
import org.ewaf.framework.action.BaseAction;
import org.ewaf.framework.exception.BizException;


import com.huarui.purchaseOrder.model.PurOrSaleOrder;
import com.huarui.purchaseOrder.service.PurchaseOrderService;
import com.huarui.user.model.SessionMessage;
import com.huarui.user.security.UserHolder;

public class PurchaseDealAction extends BaseAction{

	public static String MESS = "mess";
	private static final long serialVersionUID = -9153136419983950371L;
	private Logger logger = Logger.getLogger(PurchaseDealAction.class);
	private PurchaseOrderService purchaseOrderService;
	
	private Integer ordersId;
	private Map<String, Object> mesMap;

	public Integer getOrdersId() {
		return ordersId;
	}

	public void setOrdersId(Integer ordersId) {
		this.ordersId = ordersId;
	}

	public Map<String, Object> getMesMap() {
		return mesMap;
	}

	public void setMesMap(Map<String, Object> mesMap) {
		this.mesMap = mesMap;
	}

	public void setPurchaseOrderService(PurchaseOrderService purchaseOrderService) {
		this.purchaseOrderService = purchaseOrderService;
	}

	/**
	 * 接手订单
	 * @return
	 */
	private String dealPurOrder() {
		mesMap = this.purchaseOrderService.updateCurrenterId(ordersId);
		return MESS;
	}
	
	/**
	 * 在线接手订单
	 * @return
	 */
	public String onlineDealPurOrder() {
		return dealPurOrder();
	}
	
	/**
	 * 非在线接手订单
	 * @return
	 */
	public String notOnlineDealPurOrder() {
		return dealPurOrder();
	}
}
